#pragma once

/*
	A world cell represents a tile on the worldspace map, and is a zoomed out region.
*/

#include "../../Math/Vec2i.h"
#include "../../Math/Vec3f.h"
#include <libtcod/libtcod.hpp>
#include <memory>

namespace World
{
	class Region;
	typedef std::shared_ptr<Region> RegionPtr;

	class WorldCellData
	{
	public:
		Vec3f position;
		Vec2i pos2d;
		TCODColor color;
		Vec3f color3f;

		bool visited;

		RegionPtr region;

		WorldCellData() : visited(false) {}
	};
	typedef std::unique_ptr<WorldCellData> WorldCellDataUPtr;

	class WorldCell
	{
	public:
		WorldCell(const Vec3f &position);
		~WorldCell();

		const Vec3f &getPosition() const { return data->position; }
		const RegionPtr &getRegion() const { return data->region; }

		void generate();
		void zoom(int world_seed, int world_size, bool canFastTravel);

		void render();

	private:
		WorldCellDataUPtr data;
	};
}
